#include<iostream>
#include<cmath>
using namespace std;
int main(){
int a, b, c, d, e, z, s, m ;
cout <<"   ";
cin>>a;
if(a < 1000 or a>9999)
    cout<<"    ";
else{
if (a%2 == 0)
    cout<<" : "<<endl;
else
    cout<<" : "<< endl;
if (a%3 == 0)
    cout<<"  : "<<endl;
else
    cout<<"  : "<< endl;
if (sqrt(a) == int(sqrt(a)))
    cout<<"   : "<<sqrt(a)<<endl;
else
    cout<<"   :  "<<endl;
b = a/1000;
c = (a/100)%10;
d = (a / 10)%10;
e = a%10;
z = 0;
m = 0;
if ( b == 0)
    z=z+1;
if (c  == 0)
    z=z+1;
if (d == 0)
    z=z+1;
if ( e == 0)
    z=z+1;
cout<<"  : "<<m;
if (b <c and b<d and b<e)
    s = b;
if (c <b and c<d and c<e)
    s = c;
if (d <c and d<b and d<e)
    s = d;
else
    s = e;
cout<<"  : "<<s;
cout<<"   : "<<z<<endl;
if (b >c and b>d and b>e)
    m = b;
if (c >b and c>d and c>e)
    m = e;
if (d >c and d>b and d>e)
    m = d;
else
    m = e;

cout<<"  : "<<m;

}
}
